#include<iostream>

using namespace std;

int GetxxxCount( int xxx, int& count )
{
	if (1 == xxx)
	{
		return 0;
	}

	if (xxx%2 == 0)
	{
		xxx = xxx/2;
		count++;
		if (GetxxxCount(xxx,count) == 0)
		{
			return 0;
		}
	}

	if (xxx%2 == 1)
	{
		xxx = xxx*3 + 1;
		xxx = xxx/2;
		count++;
		if (GetxxxCount(xxx,count) == 0)
		{
			return 0;
		}
	}	
}

int main()
{
	int xxx;	
	while(cin>>xxx)
	{
		int count = 0;
		if (xxx == 0)
		{
			break;
		}

		GetxxxCount(xxx, count);
		cout<<count<<endl;
	}

	return 1;
}